<!DOCTYPE html>
<html lang="en">
<head>
    <#import "../common/common.macro.ftl" as netCommon>
	<@netCommon.commonStyle />
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <!-- header -->
	<@netCommon.commonHeader />
    <!-- left -->
	<@netCommon.commonLeft "manage" "person" />

    <div class="content-wrapper">

        <section class="content-header">

        </section>

        <section class="content">
            <#if users?exists >
                <div class="row">
                    <div class="col-xs-12">
                        <div class="box">
                            <div class="box-header">
                                <div class="col-sm-2">
                                    <button type="button" class="btn btn-block btn-primary" onclick="toAddUser()">新增用户</button>
                                </div>
                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <table id="dataList" style="width:100%" class="table table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th>姓名</th>
                                        <th>邮箱</th>
                                        <th>手机</th>
                                        <th>部门</th>
                                        <th>备注</th>
                                        <th>注册时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <#list users as item>
                                    <tr id="${item.id}">
                                        <td>${item.name!''}</td>
                                        <td>${item.mail!''}</td>
                                        <td>${item.phone!''}</td>
                                        <td>${item.depName!''}</td>
                                        <td>${item.remark!''}</td>
                                        <td>${item.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
                                        <td>
                                            <div class="col-md-4">
                                                <button onclick="updateUser('${item.username}')" type="button" class="btn btn-block btn-warning btn-xs">编辑</button>
                                            </div>
                                            <div class="col-md-4">
                                                <button onclick="resetUser('${item.username}')" type="button" class="btn btn-block btn-warning btn-xs">重置</button>
                                            </div>
                                            <div class="col-md-4">
                                                <button onclick="deleteUser('${item.id}','${item.username}')" type="button" class="btn btn-block btn-danger btn-xs">注销</button>
                                            </div>
                                        </td>
                                    </tr>
                                    </#list>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.box-body -->
                        </div>
                        <!-- /.box -->
                    </div>
                </div>
            </#if>
        </section>
    </div>
        <!-- Main content -->
</div>

<@netCommon.commonScript />
<script src="${request.contextPath}/static/js/user.js"></script>
</body>
</html>